package com.lovo.system.controller;

import com.lovo.system.dto.SaleDetailsDto;
import com.lovo.system.service.ISaleDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/saleDetails")
public class SaleDetailsController {

    @Autowired
    ISaleDetailsService saleDetailsService;

    @RequestMapping("/info")
    public List<SaleDetailsDto> info(int fkId){
        return saleDetailsService.info(fkId);
    }

    @RequestMapping("/add")
    public void addSaleDetails(@RequestBody SaleDetailsDto saleDetailsDto){
        saleDetailsService.insertSaleDetails(saleDetailsDto);
    }

}
